home *** CD-ROM | disk | FTP | other *** search
/ Mac100% 1999 April / MAC100-1999-04.ISO.7z / MAC100-1999-04.ISO / オンラインソフト定点観測 / Demo / MacToPic Plus 8.8.0 Demo.sea / MacToPic +™ Demo / Plus sample programs / MAC-TO-HOST PROGRAM < prev    next >
Text File  |  1996-07-16  |  2KB  |  73 lines

  1. *
  2. * MAC-TO-HOST Data transfer program
  3. * Accepts data from a Macintosh and puts it in a hold file on the host.
  4. * You must create a hold file called HOLD before running this program.
  5. *     Example: CREATE-FILE (HOLD 1,1 10,1)
  6. *
  7. * This program is supplied by Carnation Software for use with MacToPic.
  8. * Transfer it to your PICK host with the 'Mac-To-Host Transfer' option
  9. * then compile and run it."
  10. *
  11. *Each new line transferred to the PICK host will become a new item in
  12. *the HOLD file.
  13. *NOTE: If you also want each field in a line to become a new attribute, 
  14. *      make sure that 'Convert tabs to Attribute marks' is enabled in
  15. *      the 'Mac-To-Host Transfer Options' under the Edit Menu
  16. *      in MacToPic.
  17. *
  18. * You may modify this program to suit your needs.
  19. *
  20. PRINT @(-1):
  21. PRINT"This file transfer routine will replace the current contents"
  22. PRINT"of the file named HOLD with data transferred from a Mac text file"
  23. PRINT "Do you want to continue ":
  24. INPUT A,80
  25. IF OCONV(A,"MCU")[1,1] = "Y" OR OCONV(A,"MCU")[1,1] = "y" THEN
  26. OPEN "HOLD" TO HOLD ELSE
  27. PRINT "UNABLE TO OPEN 'HOLD'FILE"
  28. END
  29. 10 *
  30. CLEARFILE HOLD
  31. *EXECUTE "CLEAR-FILE HOLD"   ;*USE THIS IF CLEARFILE HOLD DOES NOT WORK
  32. TOTAL.RECORDS = 0
  33. PRINT @(-1):
  34. *INSTRUCT USER WHAT SELECTIONS TO MAKE ON THE MACINTOSH TO INITIATE
  35. *THE TRANSFER
  36. *
  37. PRINT @(-1)
  38. PRINT @(1,5)
  39. PRINT"TO BEGIN THE FILE TRANSFER:"
  40. PRINT
  41. PRINT '1) Select Mac-To-Host Transfer Options from the Edit menu, then click "OK".'
  42. PRINT '2) Select Mac-To-Host Transfer from the File Menu.'
  43. PRINT '3) Select the file you want to transfer then click OPEN.'
  44. PRINT
  45. PRINT"(Type END when the data transfer is done)"
  46. PRINT"Data will be transferred to a file called HOLD"
  47. *
  48. *READ IN THE DATA FROM THE MACINTOSH
  49. *
  50. *ADD EACH RECEIVED RECORD TO THE "HOLD" FILE USING THE
  51. *RECORD NUMBER TO BE THE ITEM NUMBER ASSIGNMENT.
  52. *
  53. 60 *
  54. INPUT A,1500
  55. IF OCONV(A,"MCU")[1,3] = "END" OR OCONV(A,"MCU")[1,4] = "QUIT" THEN
  56. PRINT @(-1)
  57. PRINT"TRANSFER DONE"
  58. GOTO 999
  59. END
  60. *
  61. *
  62. TOTAL.RECORDS = TOTAL.RECORDS +1
  63. X.HOLD = A
  64. IF A<>"" THEN
  65. WRITE X.HOLD ON HOLD, TOTAL.RECORDS
  66. END
  67. GOTO 60
  68. *
  69. 999 *
  70. PRINT CHAR(7)
  71. END
  72. END
  73.